#ifndef OSCILLOSCOPEFRAME_H
#define OSCILLOSCOPEFRAME_H

#include <QFrame>
#include <QtCore/QTimer>

namespace Ui {
    class OscilloscopeFrame;
}

class OscilloscopeCanvas;
class QSettings;

//Q_DECLARE_METATYPE(OscilloscopeFrame);

class OscilloscopeFrame : public QFrame
{
    Q_OBJECT

	static int s_nameCounter;
private slots:
    void uiUpdate();
    void evaluateCode();
    void beautifyCode();

public:
    QTimer timer;

    OscilloscopeFrame(QWidget *parent = 0);
    ~OscilloscopeFrame();

    const OscilloscopeCanvas & getOscilloscopeWidget() const;
    OscilloscopeCanvas & getOscilloscopeWidget();
    void writeSettings(QSettings & settings) const;
    void readSettings(QSettings & settings);

public slots:
    void selectBackgroundColor(bool bFromOscilloscope = false);
    void selectGridColor(bool bFromOscilloscope = false);
    void selectAxisColor(bool bFromOscilloscope = false);
    void selectHudColor(bool bFromOscilloscope = false);
    void selectSignalColor(bool bFromOscilloscope = false);
    void setButtonSignalColor();
    void uiUpdateFromOscilloscope();

private:
    Ui::OscilloscopeFrame *ui;

	//Q_DISABLE_COPY(OscilloscopeFrame)
};

QDataStream &operator<<(QDataStream &ds, const OscilloscopeFrame &o);
QDataStream &operator>>(QDataStream &ds, OscilloscopeFrame &o);

#endif // OSCILLOSCOPEFRAME_H
